<?php

/**
 * JingYao-backend
 *
 * @link     https://gitee.com/wang-zhihui-release/jingyao-backend
 * @apiDocument https://gitee.com/wang-zhihui-release/jingyao-backend/wikis/
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminActionsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        // 记录所有后台 action 的表 这个表基本只能由开发者手动维护
        // 因为对路由本身的修改是改了代码的
        Schema::create('admin_actions', function (Blueprint $table) {
            $table->id();
            $table->string('action_name')->comment('request->route()->getActionName() 获取到的 action_name');
            $table->string('action_desc')->comment('action 的说明');
            $table->string('uuid')->default('');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('admin_actions');
    }
}
